package com.home.rest;

import com.github.pagehelper.PageInfo;
import com.home.base.msg.TableResultResponse;
import com.home.base.rest.BaseRestController;
import com.home.biz.JobLogBiz;
import com.home.entity.JobLog;
import com.home.entity.JobUser;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：chenxf
 * @date ：Created in 2019/6/19 10:32
 * @description：
 * @modified By：
 * @version: $
 */
@RestController
@RequestMapping("jobLog")
public class JobLogController extends BaseRestController<JobLogBiz, JobLog> {

    @GetMapping("/list")
    public TableResultResponse<JobLog> list(int limit, int offset) {
        List<JobLog> items = baseBiz.list(limit,offset);
        PageInfo<JobLog> pageInfo = new PageInfo<>(items);
        return new TableResultResponse<>(Integer.parseInt(String.valueOf(pageInfo.getTotal())),
                limit, offset,
                items);
    }
}
